<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
	<h:form id="formulario">
		<div data-spy="affix" data-offset-top="111">
		    <div class="navbar navbar-fixed navbar-inverse">
				<div class="navbar-inner">
					<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    	<span class="icon-bar"></span>
                    	<span class="icon-bar"></span>
                    	<span class="icon-bar"></span>
                    	<span class="icon-bar"></span>
                  	</a>
	                <a href="#" class="brand">AutoGuia</a>
					<div class="nav-collapse collapse">
                    	<ul class="nav">
                      		<li>
                      			<h:commandLink action="#{homeControlador.listarAnuncios}">
									<h:outputText value="Inicio" />
					      		</h:commandLink>
					      	</li>
                      		<li>
                      			<h:commandLink action="#{anuncioControlador.cadastrarVeiculo}">
									<h:outputText value="Anunciar" />
					      		</h:commandLink>
					  		</li>
					  		<li>
                      			<p:commandLink onclick="dialogUpload.show()">
									<h:outputText value="Anuncio Restrito" />
									
					      		</p:commandLink>
					  		</li>
					  		<p:dialog id="modalDialog" header="Importar Imagens" widgetVar="dialogUpload" modal="true" height= "564" width= "700">  
		  						<h:form>  
								    <p:fileUpload fileUploadListener="#{anuncioControlador.uploadExcel}" mode="advanced" dragDropSupport="false"  
								                  update="messages" sizeLimit="1000000" fileLimit="3" allowTypes="/(\.|\/)(xls)$/" 
								                  cancelLabel="Cancelar" label="Escolher" uploadLabel="Carregar Excel"/>  
								  
								    <p:growl id="messages" showDetail="true"/>  
								  
								</h:form>   
							</p:dialog>
                      		<!-- <li class="dropdown">
                        		<a data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown <b class="caret"></b></a>
                        		<ul class="dropdown-menu">
                          			<li><a href="#">Ação</a></li>
                          			<li><a href="#">Outra ação</a></li>
                          			<li><a href="#">Algo a mais aqui</a></li>
                          			<li class="divider"></li>
                          			<li class="nav-header">Nav header</li>
                          			<li><a href="#">Link separador</a></li>
                          			<li><a href="#">Um ou mais links separados</a></li>
                        		</ul>
                      		</li> -->
                    	</ul>
						<ul class="nav pull-right">
							<li>
								<p:commandLink action="#{homeControlador.indexarLucene()}">
									<i class="icon-cogs"></i>
									<p:spacer width="5px;" />
									<h:outputText value="Reindexar Lucene" />													
								</p:commandLink>
							</li>	
							<!-- <li>
								<h:inputHidden id="token" value="#{usuarioControlador.token}" />
								<h:inputHidden id="nome" value="#{usuarioControlador.usuario.nome}" />
								<h:inputHidden id="email" value="#{usuarioControlador.usuario.email}" />
								<h:inputHidden id="datanascimento" value="#{usuarioControlador.usuario.datanascimento}" />
								<p:commandLink id="asd" actionListener="#{usuarioControlador.loginFacebook}" style="display: none;"/>
								<h:outputLink id="loginFacebook" onclick="login(); return false;">Log in</h:outputLink>
							</li> -->
	                    </ul> 
					</div><!-- /.nav-collapse -->
					  <div class="navbar-search">
                      	<p:autoComplete id="buscar" minQueryLength="3" styleClass="span4" maxResults="8" scrollHeight="470" var="v" value="#{homeControlador.campoPesquisa}" effect="fade" completeMethod="#{homeControlador.complete}">
							<p:column style="border:none">  
								<p:graphicImage styleClass="img-rounded" value="/pics/#{v.urlImagemPrincipal}" width="75" height="75"/>  
							</p:column>
							<p:column style="border:none">  
								<p:outputLabel value="#{v.veiculo.modelo.nome} - Ano #{v.veiculo.ano}"></p:outputLabel>
							</p:column> 
						</p:autoComplete>
						<p:watermark for="buscar" value="Pesquise por Nome ou Ano ou Marca "/>
                	</div>
				</div>
			</div><!-- /navbar-inner -->
		</div>
	</h:form>
</ui:composition>